package com.example.entity;


import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author 朽
 */
@TableName(value ="user")
@Data
public class User implements Serializable {
    /**
     * ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 创建者
     */
    @TableField(value = "create_by")
    private String createBy;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 删除标志 true/false 删除/未删除
     */
    @TableField(value = "delete_flag")
    @TableLogic(delval = "1")
    private Boolean deleteFlag;

    /**
     * 更新者
     */
    @TableField(value = "update_by")
    private String updateBy;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT)
    private LocalDateTime updateTime;

    /**
     * 会员生日
     */
    @TableField(value = "birthday")
    private LocalDateTime birthday;

    /**
     * 会员状态
     */
    @TableField(value = "disabled")
    private Boolean disabled;

    /**
     * 会员头像
     */
    @TableField(value = "profile")
    private String profile;

    /**
     * 是否开通店铺
     */
    @TableField(value = "have_store")
    private Boolean haveStore;

    /**
     * 手机号码
     */
    @TableField(value = "phone")
    private String phone;

    /**
     * 会员昵称
     */
    @TableField(value = "nick_name")
    private String nickName;

    /**
     * 会员密码
     */
    @TableField(value = "password")
    private String password;

    /**
     * 积分数量
     */
    @TableField(value = "point")
    private Long point;

    /**
     * 会员性别
     */
    @TableField(value = "sex")
    private Integer sex;

    /**
     * 店铺ID
     */
    @TableField(value = "store_id")
    private Long storeId;

    /**
     * 会员用户名
     */
    @TableField(value = "username")
    private String username;

    /**
     * 会员地址
     */
    @TableField(value = "region")
    private String region;

    /**
     * 会员地址ID
     */
    @TableField(value = "region_id")
    private String regionId;

    /**
     * 客户端
     */
    @TableField(value = "client_enum")
    private String clientEnum;

    /**
     * 最后一次登录时间
     */
    @TableField(value = "last_login_date")
    private LocalDateTime lastLoginDate;

    /**
     * 经验值

     */
    @TableField(value = "experience")
    private Long experience;

    /**
     * 用户等级
     */
    @TableField(value = "grade_id")
    private String gradeId;



    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}